<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" type="text/css" href="__CSS__/admin.css"/>
<script type="text/javascript" src="__JS__/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    var checkbox_length = $('.checkbox').length - 2;
    $('.delete_entry').click(function() {
        return confirm("确认删除这条目吗？");
    });
    $('.check_all_checkbox').click(function() {
        if ($(this).attr('checked') == true) {
            $('.checkbox').attr('checked', true);
        } else {
            $('.checkbox').attr('checked', '');
        }
    });
    $('.delete_all').click(function() {
        if (confirm("确认删除选择的条目吗？") == false) {
            return false;
        }
        $('.checkbox').each(function() {
            if ($(this).attr('id') == 'checkbox11' || $(this).attr('id') == 'checkbox') {
                return;
            }
            if ($(this).attr('checked') == true) {
                var file_id = $(this).attr('id').slice(9);
                var file_name = $(this).attr('name');
                $.get('admin.php', {'m':'File', 'a':'delete', 'id':file_id, 'savename':file_name, 'random':Math.random()}, function() {
                    checkbox_length--;
                    if (checkbox_length == 0) {
                        alert('所选条目删除成功！');
                        window.location.reload();
                    }
                });
            } else {
                checkbox_length--;
            }
        });
    });
});
</script>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr bgcolor="#353c44">
            <td height="20" width="40%" class="STYLE10 tr_top" colspan="2"><img src="__IMG__/tb.gif" width="14" height="14" /> <span class="STYLE1 text_top">文件列表</span></td>
            <td><div align="right"><span class="STYLE1">
              <input type="checkbox" name="checkbox11" id="checkbox11" class="checkbox check_all_checkbox" />
              全选      &nbsp;&nbsp;<a href="{:U('File/add')}"><img src="__IMG__/add.gif" width="10" height="10" /> 添加</a>   &nbsp; <a href="#" class="delete_all"><img src="__IMG__/del.gif" width="10" height="10" /> 删除</a>   &nbsp;</span><span class="STYLE1"> &nbsp;</span></div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
      <tr>
        <td width="10%" height="20" bgcolor="d3eaef" class="STYLE10"><div align="center">
          <input type="checkbox" name="checkbox" id="checkbox" class="checkbox check_all_checkbox" />
        </div></td>
        <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">ID</span></div></td>
        <td width="40%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">文件名称</span></div></td>
        <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">文件下载</span></div></td>
        <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">文件类型</span></div></td>
        <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">基本操作</span></div></td>
      </tr>
      <volist name="file" id="vo">
      <tr>
        <td height="20" bgcolor="#FFFFFF"><div align="center">
          <input type="checkbox" name="{$vo.file_savename}" id="checkbox_{$vo.file_id}" class="checkbox" />
        </div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE6"><div align="center"><span class="STYLE19">{$vo.file_id}</span></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">{$vo.file_name}</div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><a href="{:U('File/download?savename=' . $vo['file_savename'])}">{$vo.file_savename}</a></div></td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center">{$vo.cat_name}</div></td>
        <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE21"><a class="delete_entry" href="{:U('File/delete?id=' . $vo['file_id'] . '&savename=' . $vo['file_savename'])}">删除</a></div></td>
      </tr>
      </volist>
    </table></td>
  </tr>
  <tr>
    <td><div id="nav_wrap">{$page}</div></td>
  </tr>
</table>
</body>
</html>
